package com.lrm.blog.web;

import com.lrm.blog.service.BlogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

/**
 * @PROJECT_NAME: blog
 * @DESCRIPTION:
 * @USER: "Wang Hong"
 * @DATE: 2022/8/27 20:59
 */
@Controller
public class ArchiveShowController {

    @Autowired
    private BlogService blogService;



    @GetMapping("/archives")
    public String archives(Model model) {

        model.addAttribute("archiveMap",blogService.archiveBlog());
        model.addAttribute("blogCount",blogService.countBlog());
        return "archives";
    }
}
